<template>
  <div id="InvitationList">
    <el-row>
      <el-col :span="24">
        <el-table :data="InvitationList" border highlight-current-row fit>
          <el-table-column type="index" :label="$t('index')" width="70" align="center"></el-table-column>
          <el-table-column prop="company_name" label="公司名称" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column prop="job_title" label="职位名称" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column prop="interview_place" label="工作地点" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column prop="interview_time" label="工作时间" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column prop="upstring_time" label="通知时间" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column label="操作" align="center">
            <template slot-scope="scope">
              <el-tooltip class="item" effect="light" content="接收" placement="top">
                <i class="fa fa-check-circle icon-style" @click="Operation(scope.row,2)"></i>
              </el-tooltip>
              <el-tooltip class="item" effect="light" content="拒绝" placement="top">
                <i class="fa fa-times icon-style" @click="Operation(scope.row,3)"></i>
              </el-tooltip>
              <el-tooltip class="item" effect="light" content="忽略" placement="top">
                <i class="fa fa-stop-circle-o icon-style" @click="Operation(scope.row,4)"></i>
              </el-tooltip>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination @current-change="handleCurrentChange" layout="total,prev,pager,next" :total="total"
                       class="table-page-style"></el-pagination>
      </el-col>
    </el-row>
  </div>
</template>
<script>
  import { postDataToServer } from '../../assets/js/post.js'
  import { getStaticMapList } from '../../assets/js/GlobeDefine.js'

  export default {
    name: 'InvitationList',
    props: ['status'],
    data () {
      return {
        InvitationList: [],
        page_no: 1,
        total: 0,
      }
    },
    created () {
      this.getInvitationList()
    },
    methods: {
      handleCurrentChange (pageNum) {
        this.page_no = pageNum
      },
      getInvitationList (pageNum) {
        let _this = this
        let params = new Object()
        params.page_no = this.page_no
        params.page_size = 20
        params.type = 1
        if (_this.status !== 5) {
          params.status = _this.status
        }
        postDataToServer('HM_PERSONAL_INTERVIEW_LISTPAGE', params)
          .then((data) => {
            this.InvitationList = data.data_list
            this.total = data.total_results
            if (data.status !== 0) {
              commonNotify(_this, 1, 'GET')
            }
          }).catch((error) => {
          commonNotify(_this, 1, 'GET')
        })
      },
      Operation (data, status) {
        let _this = this
        let params = new Object()
        params.status = status
        params.id = data.id
        postDataToServer('HM_PERSONAL_INTERVIEW_EDIT', params)
          .then((data) => {
            if (data.status === 0) {
              _this.getInvitationList()
              _this.$emit('ViewState', true)
            }
          })
      },
      //    changeStatus(num){
      //    	let _this = this;
      //        let params = new Object();
      //        params.status = num;
      //        if(_this.sels.length !== 0){
      //        	for(let i=0;i<_this.sels.length;i++){
      //       			params.id = _this.sels[i];
      //         	postDataToServer("HM_PERSONAL_INTERVIEW_EDIT",params)
      //         	.then((data) => {
      // 	            if(data.status === 0){
      // 	          		_this.getInvitationList();
      // 	          		_this.$emit('ViewState',true);
      // 	            }
      // 	        })
      //        	}
      //        	_this.sels = [];
      //        	_this.currentId = '';
      //        } else {
      //        	_this.$message({
      //            	message:'请选中一行',
      //            	type:'warning'
      //            });
      //    	}
      // }
    }
  }
</script>

<style scoped>
  .icon-style {
    font-size: 20px;
    color: #20a0ff;
    margin: 5px;
    cursor: pointer;
  }
</style>
